#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>

void sig_handler(int);

void sig_handler(int sig)
{
    printf("SIGUSR1 is caught\n");
    exit(-1);
}

int main(int argc, char **argv)
{
    pid_t pid;
    struct sigaction nact;

    nact.sa_handler = sig_handler;
    nact.sa_flags = 0;

    pid = getpid();
    sigaction(10, &nact, NULL);
    kill(pid, 10);
    exit(0);
}

